<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/17
 * Time: 15:01
 * Description: 微信用户模型
 */
namespace app\api\logic;

use app\api\model\Collection;
use plugin\saiadmin\basic\BaseLogic;


class CollectionLogic extends BaseLogic {

    public function __construct() {
        $this->model = new Collection();
    }
    public function getMe($userId){
        $this->model=$this->model->where('user_id',$userId);
        $data = $this->model->where('user_id', $userId)
            ->group('type')
            ->column('count(id) as num', 'type');
        return $data;
    }
  
}